<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录 - 智界论坛</title>
    <link rel="stylesheet" href="css/tech-style.css">
</head>
<body>
<div class="main-container">
    <div class="loginBox fade-in-up">
        <div class="header">
            <h2>智界论坛</h2>
            <p>科技交流社区</p>
        </div>
        <form method="post" action="login">
            <%-- 显示错误消息 --%>
            <% if (request.getAttribute("error") != null) { %>
                <div class="alert alert-danger" style="margin-bottom: 15px; padding: 10px; background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; border-radius: 4px;">
                    <%= request.getAttribute("error") %>
                </div>
            <% } %>
            <div class="item">
                <input type="text" id="username" name="username" required placeholder=" ">
                <label for="username">用户名</label>
            </div>
            <div class="item">
                <input type="password" id="password" name="password" required placeholder=" ">
                <label for="password">密码</label>
            </div>
            <div class="form-group">
                <button type="submit" class="btn btn-primary w-100">登录</button>
            </div>
            <div class="text-center" style="margin-top: 15px;">
                <p>还没有账户？<a href="register.jsp" style="color: #007bff; text-decoration: none;">立即注册</a></p>
            </div>
        </form>
    </div>
</div>
</body>
</html>